#pragma once

#include "stdafx.h"

enum EMenuItems
{
  miTabFavorites,
  miTabCallLog,
  miTabContacts,
  miDialer,
  miKeyboard,
  miBack,
  miContactView,
  miContactEdit,
  miContactDelete,
  miContactFavorite,
  miContactAdd,
  miOutlook,

  miCallLogMissed,
  miCallLogIncoming,
  miCallLogOutgoing,

  miCount,
  miNone
};

enum ESpecialIcons
{
  siCallLogMissed   = 0,
  siCallLogIncoming = 1,
  siCallLogOutgoing = 2,
  siSmsAction       = 3,
  siContactNoPicture= 4,
  siSimContact      = 5,
  siSelected        = 6,

  siCount,
  siNone
};

enum EDetailsAction
{
  daSms = 0,
  daCount,
  daNone
};

enum EDetailsIcon
{
  diMobileNumber = 0,
  diHomeNumber,
  diBusinessNumber,
  diCarNumber,
  diRadioNumber,
  diHomeFax,
  diBusinessFax,
  diPager,
  diEmail,
  diWebPage,
  diHomeAddress,
  diBusinessAddress,
  diCallType,
  diDate,
  diDuration,
  diRepeated,
  diNotes,
  diCompanyNumber,
  diInstantMessenger,
  diNickname,
  diCategories,
  diAnniversary,
  diBirthday,
  diRingtone,
  diCount,
  diNone
};

class Theme
{
public:
  static void Create(HWND hWnd);
  static void Destroy();

  static void DrawMenuItem(HDC hdc, int x, int y, int cx, int cy, EMenuItems item, bool selected);
  static void DrawMenuBg(HDC hdc, int x, int y, int cx, int cy, EMenuItems item);
  static void DrawSpecialIcon(HDC hdc, int x, int y, ESpecialIcons icon);
  static void DrawDetailsAction(HDC hdc, int x, int y, EDetailsAction action);
  static void DrawDetailsIcon(HDC hdc, int x, int y, EDetailsIcon icon);
  static int GetSmalIconIndex(EDetailsIcon icon);
  static bool HasSmallIcons;
  static bool IsSmallIcon(EDetailsIcon icon);

  // skin
  static HBITMAP  hbmSkin;
  static HDC      hdcSkin;
  static HBITMAP  hbmTemp;
  static HDC      hdcTemp;
  static int      iSkinWidth;
  static int      iSkinHeight;
  static COLORREF rgbTransparentColor;

  // common pictures
  static int      ListPictureWidth;
  static int      ListPictureHeight;

  static int      SpecialIconsWidth;
  static int      SpecialIconsHeight;
  static int      SpecialIconsY;

  // titlebar
  static COLORREF rgbTitlebarBackground;
  static COLORREF rgbTitlebarText;
  static COLORREF rgbTitlebarSignal;
  static COLORREF rgbTitlebarBattery;
  static HBRUSH   hbrTitlebarBackground;
  static HBRUSH   hbrTitlebarText;
  static HBRUSH   hbrTitlebarSignal;
  static HBRUSH   hbrTitlebarBattery;
  static HFONT    TitlebarFont;
  static int      TitlebarFontSize;
  static int      TitlebarHeight;
  // titlebar skin elements
  static int      TitlebarSkinWIDTH;
  static int      TitlebarSkinICON_SPACING;
  static int      TitlebarSkinBATTERY_X_OFFSET;
  static int      TitlebarSkinBATTERY_WIDTH;
  static int      TitlebarSkinSPEAKER_OFF_X_OFFSET;
  static int      TitlebarSkinSPEAKER_OFF_WIDTH;
  static int      TitlebarSkinSPEAKER_ON_X_OFFSET;
  static int      TitlebarSkinSPEAKER_ON_WIDTH;
  static int      TitlebarSkinVIBRATE_X_OFFSET;
  static int      TitlebarSkinVIBRATE_WIDTH;
  static int      TitlebarSkinBLUETOOTH_X_OFFSET;
  static int      TitlebarSkinBLUETOOTH_WIDTH;
  static int      TitlebarSkinWIFI_X_OFFSET;
  static int      TitlebarSkinWIFI_WIDTH;
  static int      TitlebarSkinLOCK_X_OFFSET;
  static int      TitlebarSkinLOCK_WIDTH;
  static int      TitlebarSkinALARM_X_OFFSET;
  static int      TitlebarSkinALARM_WIDTH;
  static int      TitlebarSkinA2DP_X_OFFSET;
  static int      TitlebarSkinA2DP_WIDTH;
  static int      TitlebarSkinCONNECTION_X_OFFSET;
  static int      TitlebarSkinCONNECTION_WIDTH;
  static int      TitlebarSkinBATTERY_BAR_OFFSETX;
  static int      TitlebarSkinBATTERY_BAR_OFFSETY;
  static int      TitlebarSkinBATTERY_BAR_WIDTH;
  static int      TitlebarSkinBATTERY_BAR_HEIGHT;

  // fonts
  static HFONT PrimaryListFont;
  static HFONT DialingNoListFont;
  static HFONT SecondaryListFont;
  static HFONT DetailsHeaderFont;
  static HFONT DetailsHeaderFont2;
  static HFONT DetailsItemFont;
  static HFONT DetailsFooterFont;
  static HFONT GroupFont;
  static HFONT ListIndicatorFont;
  static HFONT KeyboardFont;
  static HFONT T9ButtonsFont;
  static HFONT T9TextFont;
  static HFONT CategoriesFont;
  static HFONT CategoriesFontBold;
  static int PrimaryListFontSize;
  static int DialingNoListFontSize;
  static int SecondaryListFontSize;
  static int DetailsHeaderFontSize;
  static int DetailsHeaderFont2Size;
  static int DetailsItemFontSize;
  static int DetailsFooterFontSize;
  static int GroupFontSize;
  static int ListIndicatorFontSize;
  static int KeyboardFontSize;
  static int T9ButtonsFontSize;
  static int T9TextFontSize;
  static int CategoriesFontSize;

  // list layout
  static int iListScrollbarWidth;
  static int iListScrollbarIndicatorWidth;
  static int iListItemSize;
  static int iListItemIndent;
  static int iListSecondaryWidth;
  static int iListGroupSize;
  static int iListGroupItemIndent;
  static int iLongTapIndWidth;
  static bool bLongTapAtRight;
  // details layout
  static int iDetailsHeaderSize;
  static int iDetailsHeaderSpacing;
  static int iDetailsPictureWidth;
  static int iDetailsItemSize;
  static int iDetailsIndent;
  static int iDetailsTypeWidth;
  static int iDetailsSubActionWidth;
  static int iDetailsBackAreaSize;
  static int iDetailsFooterSpacing;
  // other
  static int iSearchKeyboardHeight;
  static int iCategoriesItemHeight;
  static int iMinimizeAreaSize;

  // list
  static HBRUSH hbrListBackground;
  static HBRUSH hbrListGroupBackground;
  static COLORREF rgbListGroupText;
  static COLORREF rgbListItemBackground;
  static HBRUSH hbrListItemBackground;
  static COLORREF rgbListItemHoverBackground1;
  static COLORREF rgbListItemHoverBackground2;
  static COLORREF rgbListItemText;
  static COLORREF rgbListItemFavoriteText;
  static COLORREF rgbListItemSecondaryText;
  static COLORREF rgbListItemSecondaryText2;
  static COLORREF rgbListItemNumberText;
  static HBRUSH hbrListItemForeground;
  static HPEN hpenListItemForeground;
  static COLORREF rgbListItemSelectedBackground1;
  static COLORREF rgbListItemSelectedBackground2;
  static COLORREF rgbListItemSelectedText;
  static COLORREF rgbListItemSelectedShadow;
  static HBRUSH hbrListItemSeparator;
  static COLORREF rgbListIndicatorText;
  static COLORREF rgbListScrollbarIndicator;
  static HBRUSH   hbrListScrollbarIndicator;
  static COLORREF rgbLongTap;
  static HBRUSH   hbrLongTap;
  static COLORREF rgbLongTapFull;
  static HBRUSH   hbrLongTapFull;
  // call history
  static COLORREF rgbCallHistoryMissed;
  static COLORREF rgbCallHistoryIncoming;
  static COLORREF rgbCallHistoryOutgoing;
  // details
  static COLORREF rgbDetailsBackground1;
  static COLORREF rgbDetailsBackground2;
  static HBRUSH   hbrDetailsBackground;
  static COLORREF rgbDetailsHoverBackground1;
  static COLORREF rgbDetailsHoverBackground2;
  static COLORREF rgbDetailsHeaderShadow;
  static COLORREF rgbDetailsHeaderText;
  static COLORREF rgbDetailsItemShadow;
  static COLORREF rgbDetailsItemText;
  static COLORREF rgbDetailsDefaultNumber;
  static HBRUSH   hbrDetailItemSeparator;
  
  // popup
  static COLORREF rgbPopupText;
  static COLORREF rgbPopupBackground;
  static COLORREF rgbPopupGrid;
  static HBRUSH hbrPopupBackground;
  static HBRUSH hbrPopupForeground;
  static HPEN   hpenPopupGrid;

  // menu bar
  static bool MenuStretch;
  static int iMenuButtonHeight;
  static int iMenuButtonWidth;
  static int iMenuSkinY;
  static int iMenuButtonsPerRow;

  // detail icons
  static int iDetailIconsY;
  static int iDetailIconsW;
  static int iDetailIconsH;
  static int iDetailIconsPerPlane;
  static int iDetailSmallIconsW;
  static int iDetailSmallIconsH;
  static int iDetailSmallIconsY;

private:
  static void Delete(HGDIOBJ obj);
};
